﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

namespace IMIForUnity
{
    public struct InternalType
    {
        private const int IMI_USER_HANDCURSOR_COUNT = 20;

        public enum SkeletonJointState
        {
            SKELETON_JOINT_NOT_TRACKED = 0,
            SKELETON_JOINT_INFERRED,
            SKELETON_JOINT_TRACKED
        }
        public enum SkeletonState
        {
            SKELETON_NONE = 0,
            SKELETON_CALIBRATING,
            SKELETON_TRACKED,
        }
        public enum GestureResult
        {
            Failure,
            Success,
            Recognizing
        }
        public struct Point3f
        {
            public float x;
            public float y;
            public float z;
        }
        public struct ImiSkeletonData
        {
            public uint m_trackingID;
            public SkeletonState m_state;

            [MarshalAs(UnmanagedType.ByValArray, SizeConst = IMI_USER_HANDCURSOR_COUNT)]
            public ImiSkeleton.Index[] jointTypes;

            [MarshalAs(UnmanagedType.ByValArray, SizeConst = IMI_USER_HANDCURSOR_COUNT)]
            public Point3f[] points;

            [MarshalAs(UnmanagedType.ByValArray, SizeConst = IMI_USER_HANDCURSOR_COUNT)]
            public float[] m_jointPositionConfidences;

            [MarshalAs(UnmanagedType.ByValArray, SizeConst = IMI_USER_HANDCURSOR_COUNT)]
            public SkeletonJointState[] skeletonJointStates;
        }

    }

}

